package com.suncam.suncam2.common.result;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

/**
 * @author LZM
 * @version 1.0
 * @Date 2022/1/14
 * @Description 统一封装返回值
 */
@AllArgsConstructor
@ToString
@Getter
public enum ResponseEnum {
    /**
     * 功能：success: 登录成功，封装了常用的响应消息和响应码
     * @param
     * @return
     * @author lzm
     * @date 2021/12/22 16:45
     */
    SUCCESS(1,"登录成功!"),
    ERROR(-1, "服务器内部错误！"),
    WrongPassword(0,"用户名或密码错误！"),
    //    TokenExpiredException(2,"token已过期!"),
    INVALID_TOKEN(2,"无效token！"),

    /*sql错误*/
    InsertErr(1000,"插入一条数据出错"),
    SearchOneErr(1001,"想查询一条数据，结果查找到多条"),
    UpdateErr(1002,"修改一条,结果修改了多条"),


    /*用户请求错误*/
    SignNull(2000,"签名为空"),
    SignErr(2001,"签名不匹配"),
    LoginTimeOut(2002,"登录超时"),
    ArgumentsErr(2003,"参数有误"),
    RedundantOperation(2004,"无效的操作"),

    /*系统错误*/
    NullPointer(3001,"空指针异常");


    /**响应状态码*/
    private Integer code;
    /**响应信息*/
    private String msg;

}
